package objectFactory;

import java.sql.SQLException;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;

import vo.UserVO;



public class UserDaoTest {
	public static void main(String[] args) throws ClassNotFoundException,SQLException{
	//	UserDao dao = new DaoFactory().userDao();
//		ApplicationContext context= new AnnotationConfigApplicationContext(DaoFactory.class);
//		UserDao dao = context.getBean("userDao",UserDao.class);
		
		ApplicationContext context = new GenericXmlApplicationContext("/applicationContext.xml");
		UserDao dao = context.getBean("userDao",UserDao.class);
		
		UserVO nuser = new UserVO();
		nuser.setId("test7");
		nuser.setName("test7nm");
		nuser.setPassword("test4pw");
		dao.add(nuser);
		System.out.print("등록성공N:"+nuser.getName());
		dao.get(nuser.getId());
		
		nuser =dao.get(nuser.getId());
		System.out.print("가져왔으무:"+nuser.getId());
		
		
		
	}
}
